package cn.vonce.sqlbean.example.model;

import cn.vonce.sql.annotation.SqlColumn;
import cn.vonce.sql.annotation.SqlDefaultValue;
import cn.vonce.sql.annotation.SqlId;
import cn.vonce.sql.annotation.SqlLogically;
import cn.vonce.sql.enumerate.FillWith;
import cn.vonce.sql.enumerate.IdType;
import lombok.Data;

import java.util.Date;

/**
 * 基础模型
 *
 * @author Jovi
 * @email imjovi@qq.com
 * @date 2023/10/27 16:15
 */
@Data
public class BaseEntity {

    @SqlId(type = IdType.SNOWFLAKE_ID_16)
    @SqlColumn(notNull = true, remarks = "唯一id")
    private Long id;

    @SqlColumn(remarks = "创建者")
    private Long creator;

    @SqlDefaultValue(with = FillWith.INSERT)
    @SqlColumn(remarks = "创建时间")
    private Date createTime;

    @SqlColumn(remarks = "更新者")
    private Long updater;

    @SqlDefaultValue(with = FillWith.UPDATE)
    @SqlColumn(remarks = "更新时间")
    private Date updateTime;

    @SqlLogically
    @SqlColumn(remarks = "是否删除(0正常 1删除)")
    private Boolean deleted;

}
